<template>
  <a href="javascript:;">
    <img :src="goods.picture" />
    <p class="name ellipsis">{{goods.name}}</p>
    <p class="desc ellipsis">{{goods.desc}}</p>
    <p class="price">&yen;{{goods.price}}</p>
    <div class="btn">找相似</div>
    <i class="iconfont icon-guanbi" @click="$emit('on-cancel', goods)"></i>
  </a>
</template>

<script>
export default {
  name: 'CollectGoodsItem',
  props: {
    goods: {
      type: Object,
      default: () => {}
    }
  },
  emits: ['on-cancel']
}
</script>

<style lang="less" scoped>
a {
  width: 222px;
  height: 336px;
  text-decoration: none;
  color: #333;
  outline: none;
  display: block;
  padding: 0 5px;
  img {
    width: 150px;
    height: 150px;
  }
  p {
    padding-top: 10px;
    &.name {
    font-size: 14px;
    }
    &.desc {
    color: #666;
    }
    &.price {
    font-size: 18px;
    color: #cf4444
    }
  }
  .btn {
    width: 100px;
    height: 32px;
    border: 1px solid #e4e4e4;
    line-height: 30px;
    border-radius: 2px;
    margin: 20px auto;
    background: #f5f5f5;
  }
  i {
    position: absolute;
    right: 0;
    top: 0;
    width: 20px;
    height: 20px;
    background: #e4e4e4;
    color: #fff;
    line-height: 18px;
    display: none;
  }
  &:hover i {
    display: block;
  }
}
</style>
